import {createRouter, createWebHashHistory, createWebHistory} from "vue-router";
import Login from "@/views/login/index.vue";
import Layout from "@/views/layout/index.vue";
import Pile from "@/views/pile/index.vue";
import Bulkhead from "@/views/bulkhead/index.vue"
import Home from "@/views/home/index.vue"
import PileData from "@/views/pile/components/PileData.vue";
import PileDataTable from "@/views/pile/components/PileDataTable.vue";
import ControlPoint from "@/views/ControlPoint/index.vue";
import ControlPointData from "@/views/ControlPoint/components/ControlPointData.vue";
import PileList from "@/views/pile/components/PileList.vue";
import PileQuantity from "@/views/pile/components/PileQuantity.vue";
import PileDetails from "@/views/pile/components/PileDetails.vue";
import PilePDF from "@/views/pile/components/PilePDF.vue";
import PileInfo from "@/views/pile/components/PileInfo.vue";
import PileSVG from "@/views/pile/components/PileSVG.vue";
import Bluetooth from "@/views/bluetooth/index.vue";

/**
 * 创建路由对象，必须在main.js 配置app.use(router) 才能生效，对应的 vue中配置入口 <RouterView/>
 * @type {Router}
 */
const router=createRouter({

    /*history: createWebHistory(
        import.meta.env.BASE_URL,
    ),*/
    history: createWebHashHistory(),
    routes:[
        {
            path:'/',
            component: Layout,
            children:[
                {
                    path:'',
                    component: Home,
                },
                {
                    path:'pile',
                    component: Pile,
                    children:[
                        {
                            path:'data',
                            component: PileData,
                        }, {
                            path:'list',
                            component: PileList,
                        }, {
                            path:'quantity',
                            component: PileQuantity,
                        },{
                            path:'table',
                            component: PileDataTable,
                        },{
                            path:'details/:id',
                            component: PileDetails,
                        },{
                            path:'pileInfo/:pileNumber',
                            component: PileInfo,
                        },{
                            path:'pdf',
                            component: PilePDF,
                        },{
                            path:'pileSVG',
                            component: PileSVG,
                        }
                    ]
                },
                {
                    path:'bulkhead',
                    component: Bulkhead,
                },
                {
                    path:'bluetooth',
                    component: Bluetooth,
                },
                {
                    path:'controlPoint',
                    component: ControlPoint,
                    children:[
                        {
                            path:'data',
                            component: ControlPointData,
                        }
                    ]
                }
            ]
        },{
            path:'/login',
            component: Login
        }
    ]
})
export default router;